<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button data-toggle-id="abc">Show the subscription form</button>
    <form id="abc" hidden>Your mail: <input type="email" /></form>

    <hr />
    <button data-toggle-id="phone">phone</button>
    <div id="phone" hidden>12345678</div>

    <hr />
    <p data-toggle-id="abcef">hahah</p>
    <p>jack</p>
    <hr />
    <h1 id="abcef">hello jack</h1>
    <script>
      document.onclick = function (e) {
        if (e.target.dataset.toggleId !== undefined) {
          // id值
          const toggleId = e.target.dataset.toggleId;
          // id值=>dom对象
          const node = document.getElementById(toggleId);
          // dom对象=>dom属性
          node.hidden = !node.hidden;
        }
      };
    </script>
  </body>
</html>
